<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>request对象练习</title>
</head>
<body>
<%
	out.print(request.getServerName() + "<br/>");
	out.print(request.getServerPort() + "<br/>");
	out.print(request.getRemoteAddr() + "<br/>");
	out.print(request.getRemoteHost() + "<br/>");
	out.print(request.getRemotePort() + "<br/>");
	out.print(request.getRemoteUser() + "<br/>");
	out.print(request.getMethod()+ "<br/>");
	out.print(request.getScheme() + "<br/>");
	out.print(request.getRequestURI() + "<br/>");
	out.print(request.getContextPath() + "<br/>");
	out.print(request.getLocalName() + "<br/>");
	out.print(request.getLocalAddr() + "<br/>");
	out.print(request.getLocalPort() + "<br/>");
	out.print(request.getServletPath() + "<br/>");
	request.setAttribute("test", "test_value");
	out.print(request.getAttribute("test") + "<br/>");
	request.removeAttribute("test");
	out.print(request.getAttribute("test") + "<br/>");
	
	request.setCharacterEncoding("utf-8");
	out.print(request.getParameter("userName") + "<br/>");
 %>
</body>
</html>